<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>手机APP下载</title>
    <script type="text/javascript">
	    // param参数的名
	    function getParameter(param){
		    var query = window.location.search;
	        var iLen = param.length;
	        var iStart = query.indexOf(param);
	        if (iStart == -1) return "";
	        iStart += iLen + 1;
	        var iEnd = query.indexOf("&", iStart);
	        if (iEnd == -1)
	        　	return query.substring(iStart);
	        return query.substring(iStart, iEnd);
	    }
        
        var product = getParameter("product");
    
    	// 获取终端的相关信息
        var Terminal = {
            // 辨别移动终端类型
            platform : function(){
                var u = navigator.userAgent, app = navigator.appVersion;
                return {
                    // android终端或者uc浏览器
                    android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1,
                    // 是否为iPhone或者QQHD浏览器
                    iPhone: u.indexOf('iPhone') > -1 ,
                    // 是否iPad
                    iPad: u.indexOf('iPad') > -1
                };
            }(),
            // 辨别移动终端的语言：zh-cn、en-us、ko-kr、ja-jp...
            language : (navigator.browserLanguage || navigator.language).toLowerCase()
        }
 
        // 根据不同的终端，跳转到不同的地址
        var theUrl = '',
        	domain = 'dev.bstyun.com';//d平台(dev), p平台域名(demo), mc平台域名(www)
        if(Terminal.platform.android){
        	theUrl = 'http://'+domain+'/upload/goodsFile/'+product+'/'+product+".apk";
        }else if(Terminal.platform.iPhone){
        	if(product == 'BST-VC001') {
        		theUrl = 'https://itunes.apple.com/cn/app/mc-shi-pin-hui-yi/id938044677?mt=8';
        	}else {
        		theUrl = 'itms-services://?action=download-manifest&url=https://'+domain+'/upload/goodsFile/'+product+'/'+product+".plist";
        	}
        }
 
        location.href = theUrl;
    </script>
</head>
<body>
</body>
</html>